import mx.managers.PopUpManager;

import net.optix.ip.model.ModelLocator;
import net.optix.ip.vo.TradeMarkVO;

import views.invention.AddAction;
import views.ViewInstance;
[Bindable]
private var model:ModelLocator	=	ModelLocator.getInstance();

public var _mark:TradeMarkVO;

public function set mark(value:TradeMarkVO):void
{
	trace(value.bConfirm+"  value.bConfirm ");
	_mark	=	value;
	var isVisible:Boolean	=	false;
	
	switch(model.role)
	{
		case 1:
			if(model.client.clientID == _mark.clientID)
			{
				isVisible	=	true;
				this.label	=	"Add New Action";
			}
			break;
		case 2:
			if(model.inventor.inventorID == _mark.inventorID)
			{
				isVisible	=	true;
				this.label	=	"Post Document/Record Action";
			}
			break;
		case 3:
			if(model.firm.firmID == _mark.firmID && _mark.bConfirm	== 1)
			{
				isVisible	=	true;
				this.label	=	"Post Document/Record Action";
			}
			else
			{
				this.label	=	"Post Document/Record Action";
				isVisible	=	false;
			}
			break;
		case 4:
			if(model.practitioner.practitionerID == _mark.practitionerID && _mark.bConfirm	== 1)
			{
				isVisible	=	true;
				this.label	=	"Post Document/Record Action";
			}
			else
			{
				this.label	=	"Post Document/Record Action";
				isVisible	=	false;
			}
			break;
	}
	
	this.enabled	=	isVisible;
	
}
public function get mark():TradeMarkVO
{
	return _mark;
}

private function addAction(event:MouseEvent):void
{			
	model.actionView	=	0;
	model.actionView	=	ViewInstance.AddTradeMarkAction;
}